<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	>

<h:head>
	<title> Inscription </title>
	<link rel="stylesheet" type="text/css" href="${facesContext.externalContext.requestContextPath}/resource/css/Style.css" /> 
</h:head>
<h:body>
	<ui:include src="/entete.xhtml" />
	
	 <h:form id = "inscription">

         <fieldset>

            <legend>Inscription</legend>

  			<table width = "80%">
			<tr>
				<td>
					<p:outputLabel for="identifiant"> Identifiant <span class="requis">*</span></p:outputLabel>
				</td>
				<td>
				  	<p:inputText id="identifiant" value="#{beanInscription.utilisateur.identifiant}"  size="20" maxlength="20"  >
				  		<f:validator validatorId="idValidator" />
				  	</p:inputText>
            		<p:message id="identifiantMessage" for="identifiant" errorClass="erreur" />
            	</td>
			</tr>
			<tr>
				<td>
					<p:outputLabel for="nom">Nom d'utilisateur <span class="requis">*</span></p:outputLabel>
				</td>
				<td>
            		<p:inputText id="nom" value="#{beanInscription.utilisateur.nom}" required="true" size="20" maxlength="20"  />
            		<p:message id="nomMessage" for="nom" errorClass="erreur" />
				</td>
			</tr>
            <tr>
            	<td>           
            		<p:outputLabel for="prenom"> Prenom <span class="requis">*</span></p:outputLabel>
            	</td>
            	<td>
            		<p:inputText id="prenom" value="#{beanInscription.utilisateur.prenom}" required="true" size="20" maxlength="20" />
            		<p:message id="prenomMessage" for="prenom" errorClass="erreur" />
				</td>
			</tr>
     		<tr>
            	<td>
            		<p:outputLabel for="motdepasse">Mot de passe <span class="requis">*</span></p:outputLabel>
            	</td>
            	<td>
            		<p:password id="motdepasse" value="#{beanInscription.utilisateur.motDePasse}" required="true" size="20" maxlength="20" >
              			<f:validateRegex pattern="((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{6,20})"  />
              		</p:password>
            		<p:message id="motDePasseMessage" for="motdepasse" />
            		
				</td>
				<td><p:outputLabel value="le mot de passe doit contenir une majuscule, un chiffre et un caractaire special" style="font-size: small;"/></td>
			</tr>
            <tr>
            	<td>                   
            		<p:outputLabel for="confirmation">Confirmation du mot de passe <span class="requis">*</span></p:outputLabel>
            	</td>
            	<td>	
            		<p:password id="confirmation" value="#{beanInscription.motDePasseBis}" required="true" size="20" maxlength="20"  />
            		<p:message id="confirmationMessage" for="confirmation"  />
            	</td>
            </tr>
        </table>
            <br />
            
            <p:messages globalOnly="true" infoClass="info" />
            <h:commandButton class="boutonInscription" value="Inscription" action="#{beanInscription.inscrire}" styleClass="sansLabel" />

            <br />

          </fieldset>

        </h:form>
	
	<ui:include src="/Pied.xhtml"/>
</h:body>
</html>